package com.ysw.sql;

import java.lang.reflect.Proxy;

public class MysqlSession {

//    /**
//     * 获取SqlSession对象<br>
//     */
//
//        // 获取getMapper
//        public static <T> T getMapper(Class<T> clas)
//                throws IllegalArgumentException, InstantiationException, IllegalAccessException {
//            return (T) Proxy.newProxyInstance(clas.getClassLoader(), new Class[] { clas },
//                    new Mysession(clas));
//        }
    // 获取getMapper
    @SuppressWarnings("unchecked")
    public static <T> T getMapper(Class<T> clz)
            throws IllegalArgumentException, InstantiationException, IllegalAccessException {
        return (T) Proxy.newProxyInstance(clz.getClassLoader(), new Class[] { clz },
                new Mysession(clz));
    }

}
